package com.ms.controller;

import com.github.pagehelper.PageInfo;
import com.ms.mapper.EnterpriseMapper;
import com.ms.service.EnterpriseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created by dell on 2016/10/25.
 */
@RestController
public class EnterpriseController {

    private static Logger log = LoggerFactory.getLogger(EnterpriseController.class);

    @Autowired
    private EnterpriseService enterpriseService;

    @RequestMapping(value = "search",method = RequestMethod.GET)
    public PageInfo<Map> search(@RequestParam(required = false,defaultValue = "1") int curPage,
                                @RequestParam(required = false,defaultValue = "10") int pageSize){
        log.info("访问"+"search");
        return  enterpriseService.search(curPage,pageSize);
    }
}
